package com.moonshine.utils;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class TopLevel {
	public enum NAMES {
		Array, Boolean, Date, Number, INT, uint, String, Xml, Object, Error, Regexp, Qname, SyntaxError, SecurityError, XMLList, VerifyError, URIError, TypeError, ReferenceError, RangeError, Namespace, Math, Function, EvalError, DefinitionError, Class, ArgumentError
	}

	public static final List VALUES = Collections.unmodifiableList(Arrays
			.asList(NAMES.values()));

	public static boolean is(String type) {
		type = type.toUpperCase();
		for (Object val : VALUES) {
			if (type.equals(String.valueOf(val).toUpperCase()))
				return true;
		}
		return false;
	}
}
